﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using SportsStore.ReadRepositery.QueryStore.Abstracts;
using SportsStore.ReadRepositery.DataTransferObject;
using Raven.Client;

namespace SportsStore.ReadRepositery
{
    public class ProductQueryRepositery:IProductQueryRepositery
    {
        private readonly IDocumentSession Session;
        public ProductQueryRepositery(IDocumentSession documentSession)
        {
            Session = documentSession;
        }

        public IEnumerable<ProductDTO> GetAllProducts()
        {
            IEnumerable<ProductDTO> productList = Session.LuceneQuery<ProductDTO>().AsEnumerable();
            return productList;
        }
    }
}
